package sysuser

import (
	"context"
	"errors"
)

var ErrInvalidCredentials = errors.New("invalid username or password")
var ErrPasswordEmpty = errors.New("no password provided")

type Service interface {
	GetUserPage(context.Context, GetUserPageCommand) ([]User, int64, error)
	GetUserByWhere(ctx context.Context, cmd GetUserRequest) ([]WorkUserInfo, error)
	GetUser(ctx context.Context, cmd GetUserCommand) (User, error)
	GetUserByUserName(ctx context.Context, username string) (user User, err error)
	Create(ctx context.Context, user InsertUserCommand) error
	Update(cxt context.Context, cmd UpdateUserCommand) error
	UpdateAvatar(ctx context.Context, cmd UpdateUserAvatarReq) error
	UpdateStatus() error
	UpdateUserPwd(ctx context.Context, cmd UpdatePwdCommand) error
	Remove(ctx context.Context, cmd RemoveUserCommand) error
	ResetUpdatePwd(tx context.Context, cmd ResetPasswordCommand) error
	GetProfile() error
	AuthCheckRole(ctx context.Context, userId int64, method, path string) (bool, error)
	UpdateUserRole(ctx context.Context, cmd UpdateUserRole) error
	RefreshUserInfo(ctx context.Context, userId int64) error
	UpdateUserBasicInfo(ctx context.Context, cmd UpdateUserBasicInfoReq) error

	//UserThird 第三方登录
	UserThird(ctx context.Context, cmd UserThirdReq) (int64, bool, error)
	//UserThirdBind 第三方用户绑定
	UserThirdBind(ctx context.Context, cmd UserThirdReq) error
	//UserThirdUnBind 第三方用户解绑
	UserThirdUnBind(ctx context.Context, cmd UserThirdReq) error
	//GetUserThird 获取第三方用户信息
	GetUserThird(ctx context.Context, userId int64) ([]string, error)
}
